﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;

namespace CML.Resources
{
	public class Resource
	{
		public static string GetResource(string resourceName)
		{
			var text = "";
			var assembly = Assembly.GetAssembly(typeof(CML.Data.Environments));

			using (var stream = assembly.GetManifestResourceStream(resourceName))
			using (var reader = new StreamReader(stream))
			{
				text = reader.ReadToEnd();
			}
			return text;
		}

		public static string[] GetResourceNames()
		{
			var assembly = Assembly.GetAssembly(typeof(CML.Data.Environments));
			return assembly.GetManifestResourceNames();
		}
	}
}
